import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component:() => import('@/views/layout/LayoutContsiner.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: ()=>import ("@/views/login/login.vue")
    }
  ]
})
const whitelist = ['/login','/404']
router.beforeEach((to,from,next)=>{
 
  if(0){
    console.log('da');
  }
  else{
    if(whitelist.includes(to.path)){
      next()
    }
    else{
    next('/login')
    }
  }
 
})
export default router
